home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 February / SGI IRIX 6.5 Complementary Applications 2004 February.iso / dist / cde.idb / usr / dt / share / include / Xm / BaseClassP.h.z / BaseClassP.h
Encoding:
C/C++ Source or Header  |  2003-11-18  |  7.8 KB  |  249 lines

  1. /*
  2.  * BaseClassP.h
  3.  *
  4.  * Copyright 2000, Silicon Graphics, Inc.
  5.  * ALL RIGHTS RESERVED
  6.  * 
  7.  * UNPUBLISHED -- Rights reserved under the copyright laws of the United
  8.  * States.   Use of a copyright notice is precautionary only and does not
  9.  * imply publication or disclosure.
  10.  *
  11.  * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
  12.  * Use, duplication or disclosure by the Government is subject to restrictions
  13.  * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
  14.  * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
  15.  * in similar or successor clauses in the FAR, or the DOD or NASA FAR
  16.  * Supplement.  Contractor/manufacturer is Silicon Graphics, Inc.,
  17.  * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
  18.  *
  19.  * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
  20.  * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
  21.  * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
  22.  * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
  23.  * GRAPHICS, INC.
  24.  */
  25. /* 
  26.  * @OSF_COPYRIGHT@
  27.  * (c) Copyright 1990, 1991, 1992, 1993, 1994 OPEN SOFTWARE FOUNDATION, INC.
  28.  * ALL RIGHTS RESERVED
  29.  *  
  30. */ 
  31. /*
  32.  * HISTORY
  33.  * Motif Release 1.2.5
  34. */
  35. /*   $XConsortium: BaseClassP.h /main/cde1_maint/2 1995/08/18 18:51:12 drk $ */
  36. /*
  37. *  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  38. /*
  39. *  (c) Copyright 1989, 1990 DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  40. /*
  41. *  (c) Copyright 1988 MASSACHUSETTS INSTITUTE OF TECHNOLOGY  */
  42. #ifndef _XmBaseClassP_h
  43. #define _XmBaseClassP_h
  44.  
  45. #ifndef _XmNO_BC_INCL
  46. #define _XmNO_BC_INCL
  47. #endif
  48.  
  49. #include <Xm/XmP.h>
  50.  
  51. #ifdef __cplusplus
  52. extern "C" {
  53. #endif
  54.  
  55.  
  56. #define _XmBCEPTR(wc)    ((XmBaseClassExt *)(&(((WidgetClass)(wc))\
  57.                           ->core_class.extension)))
  58. #define _XmBCE(wc)    ((XmBaseClassExt)(((WidgetClass)(wc))\
  59.                       ->core_class.extension))
  60.  
  61. #define _XmGetBaseClassExtPtr(wc, owner) \
  62.     ((_XmBCE(wc) && (((_XmBCE(wc))->record_type) == owner)) \
  63.      ?  \
  64.      _XmBCEPTR(wc)  \
  65.      :  \
  66.      ((XmBaseClassExt *) _XmGetClassExtensionPtr( \
  67.                          ((XmGenericClassExt *)  \
  68.                           _XmBCEPTR( wc)),  \
  69.                          owner)))
  70.  
  71. /* defines for 256 bit (at least) bit field
  72.  */
  73. #define _XmGetFlagsBit(field, bit) \
  74.     (field[ (bit >> 3) ]) & (1 << (bit & 0x07))
  75.  
  76. #define _XmSetFlagsBit(field, bit) \
  77.         (field[ (bit >> 3) ] |= (1 << (bit & 0x07)))
  78.  
  79.  
  80. #define _XmFastSubclassInit(wc, bit_field) { \
  81.     if((_Xm_fastPtr = _XmGetBaseClassExtPtr( wc, XmQmotif)) && \
  82.        (*_Xm_fastPtr)) \
  83.         _XmSetFlagsBit((*_Xm_fastPtr)->flags, bit_field) ; \
  84.    }
  85.  
  86. /* _XmGetBaseClassExtPtr can return NULL or a pointer to a NULL extension,
  87.    for non Motif classes in particular, so we check that up front.
  88.    We use the global _Xm_fastPtr for that purpose, this variable exists
  89.    already in BaseClass.c for apparently no other use */
  90.  
  91. #define _XmIsFastSubclass(wc, bit) \
  92.     ((_Xm_fastPtr = _XmGetBaseClassExtPtr((wc),XmQmotif)) && \
  93.          (*_Xm_fastPtr)) ? \
  94.          (_XmGetFlagsBit(((*_Xm_fastPtr)->flags), bit) ? TRUE : FALSE) \
  95.          : FALSE
  96.  
  97. #define XmBaseClassExtVersion 2L
  98. #define XmBaseClassExtVersion 2L
  99.  
  100.  
  101. #ifdef _NO_PROTO
  102. typedef Cardinal (*XmGetSecResDataFunc) ();
  103. #else
  104. typedef Cardinal (*XmGetSecResDataFunc)( WidgetClass,
  105.                         XmSecondaryResourceData **);
  106. #endif
  107.  
  108. typedef struct _XmObjectClassExtRec{
  109.     XtPointer         next_extension;    
  110.     XrmQuark         record_type;    
  111.     long         version;    
  112.     Cardinal         record_size;    
  113. }XmObjectClassExtRec, *XmObjectClassExt;
  114.  
  115. typedef struct _XmGenericClassExtRec{
  116.     XtPointer         next_extension;    
  117.     XrmQuark         record_type;    
  118.     long         version;    
  119.     Cardinal         record_size;    
  120. }XmGenericClassExtRec, *XmGenericClassExt;
  121.  
  122. typedef struct _XmWrapperDataRec{
  123.     struct _XmWrapperDataRec *next;
  124.     WidgetClass        widgetClass;
  125.     XtInitProc        initializeLeaf;
  126.     XtSetValuesFunc    setValuesLeaf;
  127.     XtArgsProc        getValuesLeaf;
  128.     XtRealizeProc    realize;
  129.     XtWidgetClassProc    classPartInitLeaf;
  130.     XtWidgetProc    resize;
  131.     XtGeometryHandler   geometry_manager;
  132.     Cardinal        init_depth;
  133. }XmWrapperDataRec, *XmWrapperData;
  134.  
  135. typedef struct _XmBaseClassExtRec{
  136.     XtPointer         next_extension;    
  137.     XrmQuark         record_type;    
  138.     long         version;    
  139.     Cardinal         record_size;    
  140.     XtInitProc        initializePrehook;
  141.     XtSetValuesFunc     setValuesPrehook;
  142.     XtInitProc        initializePosthook;
  143.     XtSetValuesFunc     setValuesPosthook;
  144.     WidgetClass        secondaryObjectClass;
  145.     XtInitProc        secondaryObjectCreate;
  146.     XmGetSecResDataFunc    getSecResData;
  147.     unsigned char    flags[32];
  148.     XtArgsProc        getValuesPrehook;
  149.     XtArgsProc        getValuesPosthook;
  150.     XtWidgetClassProc    classPartInitPrehook;
  151.     XtWidgetClassProc    classPartInitPosthook;
  152.     XtResourceList    ext_resources;
  153.     XtResourceList    compiled_ext_resources;
  154.     Cardinal        num_ext_resources;
  155.     Boolean        use_sub_resources;
  156.     XmWidgetNavigableProc widgetNavigable;
  157.     XmFocusChangeProc    focusChange;
  158.     XmWrapperData    wrapperData;
  159. }XmBaseClassExtRec, *XmBaseClassExt;
  160.  
  161.  
  162. typedef struct _XmWidgetExtDataRec{
  163.     Widget        widget;
  164.     Widget        reqWidget;
  165.     Widget        oldWidget;
  166. }XmWidgetExtDataRec, *XmWidgetExtData;
  167.  
  168. externalref XrmQuark        XmQmotif;
  169. externalref int     _XmInheritClass;
  170. externalref XmBaseClassExt * _Xm_fastPtr;
  171.   
  172.  
  173. /********    Private Function Declarations    ********/
  174. #ifdef _NO_PROTO
  175.  
  176. extern Boolean _XmIsSlowSubclass() ;
  177. extern XmGenericClassExt * _XmGetClassExtensionPtr() ;
  178. extern void _XmPushWidgetExtData() ;
  179. extern void _XmPopWidgetExtData() ;
  180. extern XmWidgetExtData _XmGetWidgetExtData() ;
  181. extern void _XmFreeWidgetExtData() ;
  182. extern void _XmBaseClassPartInitialize() ;
  183. extern void _XmInitializeExtensions() ;
  184. extern Boolean _XmIsStandardMotifWidgetClass() ;
  185. extern Cardinal _XmSecondaryResourceData() ;
  186. extern void _XmTransformSubResources() ;
  187.  
  188. #else
  189.  
  190. extern Boolean _XmIsSlowSubclass( 
  191.                         WidgetClass wc,
  192.                         unsigned int bit) ;
  193. extern XmGenericClassExt * _XmGetClassExtensionPtr( 
  194.                         XmGenericClassExt *listHeadPtr,
  195.                         XrmQuark owner) ;
  196. extern void _XmPushWidgetExtData( 
  197.                         Widget widget,
  198.                         XmWidgetExtData data,
  199. #if NeedWidePrototypes
  200.                         unsigned int extType) ;
  201. #else
  202.                         unsigned char extType) ;
  203. #endif /* NeedWidePrototypes */
  204. extern void _XmPopWidgetExtData( 
  205.                         Widget widget,
  206.                         XmWidgetExtData *dataRtn,
  207. #if NeedWidePrototypes
  208.                         unsigned int extType) ;
  209. #else
  210.                         unsigned char extType) ;
  211. #endif /* NeedWidePrototypes */
  212. extern XmWidgetExtData _XmGetWidgetExtData( 
  213.                         Widget widget,
  214. #if NeedWidePrototypes
  215.                         unsigned int extType) ;
  216. #else
  217.                         unsigned char extType) ;
  218. #endif /* NeedWidePrototypes */
  219. extern void _XmFreeWidgetExtData( 
  220.                         Widget widget) ;
  221. extern void _XmBaseClassPartInitialize( 
  222.                         WidgetClass wc) ;
  223. extern void _XmInitializeExtensions( void ) ;
  224. extern Boolean _XmIsStandardMotifWidgetClass( 
  225.                         WidgetClass wc) ;
  226. extern Cardinal _XmSecondaryResourceData( 
  227.                         XmBaseClassExt bcePtr,
  228.                         XmSecondaryResourceData **secResDataRtn,
  229.                         XtPointer client_data,
  230.                         String name,
  231.                         String class_name,
  232.                         XmResourceBaseProc basefunctionpointer) ;
  233. extern void _XmTransformSubResources( 
  234.                         XtResourceList comp_resources,
  235.                         Cardinal num_comp_resources,
  236.                         XtResourceList *resources,
  237.                         Cardinal *num_resources) ;
  238.  
  239. #endif /* _NO_PROTO */
  240. /********    End Private Function Declarations    ********/
  241.  
  242.  
  243. #ifdef __cplusplus
  244. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  245. #endif
  246.  
  247. #endif /* _XmBaseClassP_h */
  248. /* DON'T ADD ANYTHING AFTER THIS #endif */
  249.